<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MVCWeb.Models.User>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Reset Password</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript">
        $(document).ready(function() {
            $("#UserForm").validate({
                rules: {
                    NewPassword: {
                        required: true
                    },
                    ConfirmPassword: {
                        equalTo: "#NewPassword"
                    }
                },
                messages: {
                    NewPassword: {
                        required: "Password cannot be blank"
                    },
                    ConfirmPassword: {
                        equalTo: "Confirm Password and Password must be the same"
                    }
                }
            });
        });
    </script>

    <h2 style="margin: .15in">
        Use the form below to reset password of user</h2>
    <p>
    </p>
    <%= Html.ValidationSummary() %>
    <% using (Html.BeginForm("ResetPassword", "User", FormMethod.Post, new { id = "UserForm" }))
       {%>
    <div>
        <fieldset>
            <legend>Enter new password to reset for login id: <span style="color: Yellow">
                <%= Model.LogInID %></span></legend>
            <p>
            </p>
            <p>
                <label for="NewPassword">
                    New password:</label>
                <%= Html.Password("NewPassword")%>
                <%= Html.ValidationMessage("NewPassword")%>
            </p>
            <p>
                <label for="ConfirmPassword">
                    Confirm Password:</label>
                <%= Html.Password("ConfirmPassword")%>
                <%= Html.ValidationMessage("ConfirmPassword")%>
            </p>
            <p>
                <input type="submit" value="Reset Password" />
            </p>
        </fieldset>
    </div>
    <% } %>
</asp:Content>
